home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 2010 April
/
PCWorld0410.iso
/
hity wydania
/
Ubuntu 9.10 PL
/
karmelkowy-koliberek-desktop-9.10-i386-PL.iso
/
casper
/
filesystem.squashfs
/
usr
/
sbin
/
update-info-dir
< prev
next >
Wrap
Text File
|
2009-10-27
|
975b
|
52 lines
#!/bin/bash
# update-info-dir
# create a dir file from all installed info files
# Copyright 2009 Norbert Preining
# GPLv2
INFODIR=/usr/share/info
set -e
if [ -n "$1" ] ; then
INFODIR="$1"
fi
if [ ! -d "$INFODIR" ] ; then
echo "Not a directory: $INFODIR." >&2
exit 1
fi
if [ -r "$INFODIR/dir" ] ; then
rm -f "$INFODIR/dir.old"
cp $INFODIR/dir $INFODIR/dir.old
fi
# we have to remove the dir file not make ginstall-info being surprised
rm -f "$INFODIR/dir"
errors=0
find "$INFODIR" -type f | while read file ; do
case $file in
*/dir|*/dir.gz|*/dir.old|*/dir.old.gz|*-[0-9]|*-[0-9].gz|*-[1-9][0-9]|*-[1-9][0-9].gz|*.png)
# these files are ignored
continue
;;
*)
ginstall-info "$file" "$INFODIR/dir" || {
errors=$[errors+1]
}
;;
esac
done
if [ $errors -gt 0 ] ; then
exec >&2
echo
echo "Updating the index of info documentation produced $errors errors."
fi
exit 0
# vim:set expandtab tabstop=2: #